<#assign contextPath=springMacroRequestContext.getContextPath()/>
<#import "/public/frame/main.html" as frame/>
<@frame.head "南航明珠商城-<#if isAudit>审核<#else>查看</#if>活动"></@frame.head>
<div class="page-container">
  <table class="table">
    <tr>
      <td style="width: 15%">活动类型：</td>
      <td style="width: 30%">${activeTypeMap["${active.activeType}"]}</td>
      <td style="width: 55%"></td>
    </tr>
    <tr>
      <td>活动名称：</td>
      <td>${active.name}</td>
      <td></td>
    </tr>
    <tr>
      <td>开始时间：</td>
      <td>${(active.startDate?string("yyyy-MM-dd HH:mm:ss"))!}</td>
      <td></td>
    </tr>
    <tr>
      <td>结束时间：</td>
      <td>${(active.endDate?string("yyyy-MM-dd HH:mm:ss"))!}</td>
      <td></td>
    </tr>
    <tr>
      <td>是否与买赠活动同享：</td>
      <td style="text-align: left;">
        <div class="radio-box" style="cursor:default; padding: 0px;margin: 0px;">
          <input type="radio" disabled="disabled" disabled="disabled" name="isShareBuyActive" value="1" <#if active.isShareBuyActive=="1">checked="checked"</#if>/>
          <label>同享</label>
        </div>
        <div class="radio-box" style="cursor:default;">
          <input type="radio" disabled="disabled" disabled="disabled" name="isShareBuyActive" value="0" <#if active.isShareBuyActive=="0">checked="checked"</#if>/>
          <label>不同享</label>
        </div>
      </td>
      <td></td>
    </tr>
    <tr>
      <td>是否与满赠活动同享：</td>
      <td>
        <div class="radio-box" style="cursor:default;padding: 0px;margin: 0px">
          <input type="radio" disabled="disabled" name="isShareFullActive" value="1" <#if active.isShareFullActive=="1">checked="checked"</#if>/>
          <label>同享</label>
        </div>
        <div class="radio-box" style="cursor:default;">
          <input type="radio" disabled="disabled" name="isShareFullActive" value="0" <#if active.isShareFullActive=="0">checked="checked"</#if>/>
          <label>不同享</label>
        </div>
      </td>
      <td></td>
    </tr>
    <#if active.activeType == 5>
      <tr> <!-- 满赠时显示 -->
        <td>活动商品范围：</td>
        <td>
          <div class="radio-box" style="cursor:default;padding: 0px;margin: 0px">
            <input type="radio" disabled="disabled" name="fullActiveScope" value="1" <#if active.fullActiveScope=="1">checked="checked"</#if>/>
            <label>全部商品</label>
          </div>
          <div class="radio-box" style="cursor:default;">
            <input type="radio" disabled="disabled" name="fullActiveScope" value="2" <#if active.fullActiveScope=="2">checked="checked"</#if>/>
            <label>指定商品</label>
          </div>
        </td>
        <td></td>
      </tr>
    </#if>
    <#if active.activeType == 4>
      <tr> <!-- 买赠时显示 -->
        <td>活动商品：</td>
        <td>您已选择&nbsp;<strong id="buyProNum" style="font-size: 14px;">0</strong>&nbsp;款商品</td>
        <td></td>
      </tr>
      <tr>
        <td></td>
        <td colspan="2">
          <div class="text-c">
            <table id="buyProTb" class="table table-border table-bordered table-bg radius table-striped">
              <thead> 
                <tr>
                  <th style="width: 10%">商品编号</th>
                  <th style="width: 20%">商品名称</th>
                  <th style="width: 10%">商品价格</th>
                  <th style="width: 10%">购买数量</th>
                  <th style="width: 10%">赠品编号</th> 
  	  		      <th style="width: 20%">赠品名称</th>
                  <th style="width: 10%">赠品数量</th>
                </tr>
              </thead>
              <tbody id="buyProTbody">
                <#list buyProList as burPro>
                  <tr id="${'buyProTr_' + (burPro_index + 1)}">
                    <td id="${'buyProTd_id_' + (burPro_index + 1)}">${burPro.product.id}</td>
                    <td id="${'buyProTd_name_' + (burPro_index + 1)}">${burPro.product.baseInfo.name}</td>
                    <td id="${'buyProTd_payOneMileage_' + (burPro_index + 1)}">${burPro.product.priceInfo.payOneMileage}公里</td>
                    <td id="${'buyProTd_saleNum_' + (burPro_index + 1)}">${burPro.buyNum}</td>
                    <td id="${'buyProTd_preId_' + (burPro_index + 1)}">${burPro.present.id}</td>
                    <td id="${'buyProTd_preName_' + (burPro_index + 1)}">${burPro.present.name}</td>
                    <td id="${'buyProTd_preNum_' + (burPro_index + 1)}">${burPro.presentNum}</td>
                  </tr>
                </#list>
              </tbody>
            </table>
          </div>
        </td>
      </tr>
    </#if>
    <#if active.activeType == 5>
      <tr> <!-- 满赠时显示 -->
        <td colspan="3">
      	<table class="table" style="border: 1px solid #DCDCDC; padding: 0px; margin: 0px;" cellpadding="0" cellspacing="0">
      	  <tr style="padding: 0px; margin: 0px;">
	  		<td id="ruleTd" style="padding: 0px; margin: 0px;">
	  		    <#list fullPresentRule as rule>
	  		      <table id="ruleTb_${rule_index + 1}" name="ruleTb" class="table" style="padding: 0px; margin: 0px;" cellpadding="0" cellspacing="0">
	  		  	    <tr>
	  		  	      <td colspan="3" style="font-weight: bold;font-size: 15px;padding: 5px 0px 0px 5px;">规则${rule_index + 1}：</td>
	  		        </tr>
	  		  	    <tr>
	  		  	      <td style="width: 14%;">订单金额：</td>
	  		  	      <td style="width: 30%;">${rule.orderMoney}公里</td>
	  		  	      <td style="width: 56%;"></td>
	  		  	    </tr>
	  		  	    <tr>
	  		  	      <td>活动赠品：</td>
	  		  	      <td>您已选择&nbsp;<strong id="rulePreNum_${rule_index + 1}" style="font-size: 14px;">${rule.rulePresentList?size}</strong>&nbsp;款赠品</td>
	  		  	      <td></td>
	  		  	    </tr>
	  		  	    <tr>
	  		  	      <td></td>
	  		  	      <td colspan="2">
	  		      	    <div class="text-c">
	  		        	  <table id="rulePresentTb_${rule_index + 1}" class="table table-border table-bordered table-bg radius table-striped">
	  		          	    <thead> 
	  		            	  <tr>
	  		                    <th style="width: 20%;">赠品编号</th> 
	  		   	  			    <th style="width: 25%;">赠品名称</th>
	  		   	  			    <th style="width: 25%;">供应商</th>
	  		              	    <th style="width: 10%;">剩余库存</th>
	  		              	    <th style="width: 10%;">赠品数量</th>
	  						  </tr>
	  		          	    </thead>
	  		          	    <tbody id="rulePresentTbody_${rule_index + 1}">
	  		          	      <#list rule.rulePresentList as rulePre>
	  		          	        <tr>
	  		          	          <td>${rulePre.present.id}</td>
	  		          	          <td>${rulePre.present.name}</td>
	  		          	          <td>${rulePre.present.merchant.mercName}</td>
	  		          	          <td>${rulePre.present.presentStock - rulePre.present.presentSaleStock}</td>
	  		          	          <td>${rulePre.presentSum}</td>
	  		          	        </tr>
	  		          	      </#list>
	  		          	    </tbody>
	  		        	  </table>
	  		      	    </div>
	  		  	      </td>
	  		  	    </tr>
	  	          </table>
	  		    </#list>
	          </td>
	  	  </tr>
      	</table>
        </td>
      </tr>
      <#if active.fullActiveScope=="2">
        <tr> <!-- 满赠-选择指定商品时显示 -->
          <td>活动商品：</td>
          <td>您已选择&nbsp;<strong id="fullProNum" style="font-size: 14px;">${fullProList?size}</strong>&nbsp;款商品</td>
          <td></td>
        </tr>
        <tr>
          <td></td>
          <td colspan="2">
            <div class="text-c">
              <table id="fullProTb" class="table table-border table-bordered table-bg radius table-striped">
                <thead>
                  <tr>
                    <th style="width: 9%">商品编号</th>
                    <th style="width: 20%">商品名称</th>
                    <th style="width: 20%">商品分类</th>
                    <th style="width: 20%">供应商</th>
                    <th style="width: 6%">库存</th> 
  	    		    <th style="width: 10%">商品原价</th>
                    <th style="width: 10%">商品价格</th>
                  </tr>
                </thead>
                <tbody id="fullProTbody">
                	<#list fullProList as fullPro>
                	  <tr>
                	    <td>${fullPro.product.id}</td>
                	    <td>${fullPro.product.baseInfo.name}</td>
                	    <td>
                	      ${fullPro.product.productProperty.prodTypeOne.name}&lt;
	                      ${fullPro.product.productProperty.prodTypeTwo.name}&lt;
	                      ${fullPro.product.productProperty.prodTypeThree.name}
                	    </td>
                	    <td>${fullPro.product.merchant.mercName}</td>
                	    <td>${fullPro.product.storeInfo.storeNum}</td>
                	    <td><#if fullPro.product.priceInfo.payCostMileage?? && fullPro.product.priceInfo.payCostMileage != "">${fullPro.product.priceInfo.payCostMileage + "公里"}</#if></td>
                	    <td>${fullPro.product.priceInfo.payOneMileage}公里</td>
                	  </tr>
                	</#list>
                </tbody>
              </table>
            </div>
          </td>
        </tr>
      </#if>
    </#if>
    <tr>
      <td>活动简介：</td>
      <td>${active.dec}</td>
      <td></td>
    </tr>
    <tr>
      <td>审核记录：</td>
      <td><#if !active.auditLog?? || active.auditLogList?size == 0><strong>暂无审核记录</strong></#if></td>
      <td></td>
    </tr>
    <#if active.auditLog?? && active.auditLogList?size &gt; 0>
      <tr>
        <td></td>
        <td colspan="2">
          <table class="table table-border table-bordered table-bg radius table-striped">
            <tr>
               <th>审核结果</th>
               <th>审核说明</th>
               <th>审核人</th>
               <th>审核时间</th>
            </tr>
            <#list active.auditLogList as auditLog>
              <tr>
                <td>
                  <#if auditLog.result == 2><span class="label label-success radius">审核通过</span>
                  <#elseif auditLog.result == 3><span class="label radius">审核驳回</span>
                  </#if>
                </td>
                <td>${auditLog.remark} </td>
                <td>${auditLog.userName}</td>
                <td>${auditLog.auditDate?string("yyyy-MM-dd HH:mm:ss")}</td>
              </tr>
            </#list>
          </table>
        </td>
      </tr>
    </#if>
    <#if isAudit>
      <tr>
        <td>审核意见：</td>
        <td>
          <textarea class="textarea radius" placeholder="审核意见" id="remark" name="remark" maxlength="90"></textarea>
        </td>
        <td>
          <font color="red">*</font>&nbsp;请输入90字以内的审核意见</td>
        </td>
      </tr>
      <tr>
        <td></td>
        <td colspan="2">
          <input type="button" value="审核通过" class="btn btn-success radius"  onclick="auditPass();"/>
          &nbsp;&nbsp;&nbsp;
          <input type="button" value="审核驳回" class="btn btn-warning radius" onclick="auditBack();"/>
        </td>
      </tr>
    </#if>
  </table>
</div>
<@frame.end "default"></@frame.end>
<script type="text/javascript" src="${contextPath}/resources/js/presentActivity/activity_look_or_audit.js"></script>
<script type="text/javascript">
	var path = "${contextPath}";
	var activeType = "${active.activeType}";
	var activeId = "${active.id}";
</script>